package 力扣.周赛.蔚来;

import java.util.Arrays;

public class 消灭怪物的最大数量 {
    public int eliminateMaximum(int[] dist, int[] speed) {
        int res=1;
        int[] tem = new int[dist.length];
        for (int i = 0; i < dist.length; i++) {
            if (dist[i]%speed[i]==0)
                tem[i]=dist[i]/speed[i];
            else
                tem[i]=dist[i]/speed[i]+1;
        }
        Arrays.sort(tem);
        for (int i = 1; i < tem.length; i++) {
            if (tem[i]<=i)
                return res;
            else
                res++;
        }
        return res;
    }
}
